Use a less confusing column alias in findMissingFiles.php
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 23 Sep 2014 18:27:12 +0000 (11:27 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 23 Sep 2014 18:27:16 +0000 (11:27 -0700)
Change-Id: I9c0a948e6a0dc2ed604fb8c2828fc6e5a94fec9f

maintenance/findMissingFiles.php

index 5f9f643..67864c5 100644 (file)
@@ -59,7 +59,7 @@ class FindMissingFiles extends Maintenance {
                do {
                        $res = $dbr->select(
                                array_merge( array( 'page' ), $joinTables ),
-                               array( 'img_name' => 'DISTINCT(page_title)' ),
+                               array( 'name' => 'DISTINCT(page_title)' ),
                                array( 'page_namespace' => NS_FILE,
                                        "page_title >= " . $dbr->addQuotes( $lastName ) ),
                                __METHOD__,
@@ -70,9 +70,9 @@ class FindMissingFiles extends Maintenance {
                        // Check if any of these files are missing...
                        $pathsByName = array();
                        foreach ( $res as $row ) {
-                               $file = $repo->newFile( $row->img_name );
-                               $pathsByName[$row->img_name] = $file->getPath();
-                               $lastName = $row->img_name;
+                               $file = $repo->newFile( $row->name );
+                               $pathsByName[$row->name] = $file->getPath();
+                               $lastName = $row->name;
                        }
                        $be->preloadFileStat( array( 'srcs' => $pathsByName ) );
                        foreach ( $pathsByName as $path ) {